package com.xfcy.blog.controller.web;

import com.xfcy.blog.annotation.BusinessLogger;
import com.xfcy.blog.common.R;
import com.xfcy.blog.service.PhotoAlbumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 晓风残月Lx
 * @date 2023/4/18 17:38
 */
@RequestMapping("/web/album")
@RestController
@Api(tags = "相册接口")
@RequiredArgsConstructor
public class WebPhotoAlbumController {

    private final PhotoAlbumService photoAlbumService;

    @BusinessLogger(value = "相册模块-相册列表", type = "查询", desc = "相册列表")
    @RequestMapping("/list")
    @ApiOperation(value = "相册模块-相册列表", httpMethod = "GET", response = R.class, notes = "相册列表")
    public R webAlbumList() {
        return photoAlbumService.webAlbumList();
    }

    @BusinessLogger(value = "相册模块-查看相册详情", type = "查询", desc = "查看相册详情")
    @RequestMapping("/listPhotos")
    @ApiOperation(value = "相册模块-查询相册详情", httpMethod = "GET", response = R.class, notes = "相册列表")
    public R webListPhotos(Integer albumId, Integer pageNo, Integer pageSize) {
        return photoAlbumService.webListPhotos(albumId, pageNo, pageSize);

    }

}
